{% extends 'cdserver/base.html' %}
{% load static %}

{% block title %} 审核列表 {% endblock %}

{% block header %}
    {% include 'cdserver/header.html' %}
{% endblock header %}

{% block content %}
    {# 表格内容区 #}
        <h3>审核列表</h3>
        {#   按钮   #}
        <nav class="level">
            <!-- Left side -->
            <div class="level-left">
            </div>

            <!-- Right side -->
            <div class="level-right">
                <div class="level-item">
                    <div class="field has-addons">
                        <p class="control">
                            <input class="input" type="text" placeholder="Find a post">
                        </p>
                        <p class="control">
                            <button class="button">
                                Search
                            </button>
                        </p>
                    </div>
                </div>
            </div>
        </nav>
    {#   面板    #}
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">
            <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
            发版草稿列表
        </div>

        <!-- Table -->
        <table class="table is-fullwidth is-bordered is-striped is-hoverable has-text-centered">
            <thead>
            <tr>
                <th>ID</th>
                <th>产品名称</th>
                <th>发行版本</th>
                <th>创建时间</th>
                <th>提审时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for obj in queryset %}
                <tr>
                    <th> {{ obj.id }} </th>
                    <td> {{ obj.product.name }}</td>
                    <td> {{ obj.release_version }} </td>
                    <td> {{ obj.created_time|date:"Y-m-d H:i:s" }} </td>
                    <td> {{ obj.submit_time |date:"Y-m-d H:i:s" }} </td>
                    <td> <span class="label label-success">{{ obj.get_status_display}}</span> </td>
                    <td>
                        <a class="view button is-link is-small" href="{% url 'draft_detail' obj.id %}"> 查 看 </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock content %}

{% block footer %}
    <div class="container">
        {#  分页  #}
        <nav class="pagination is-rounded" role="navigation" aria-label="pagination">
            {{ page_string }}
        </nav>
    </div>
    <div class="mt-5"></div>
{% endblock %}

